function firstNonRepeatingLetter(s) {
    var t=s.toLowerCase();
    for (var x=0;x<t.length;x++)
      if(t.indexOf(t[x]) === t.lastIndexOf(t[x]))
        return s[x];
    return "";
  }

function firstNonRepeatingLetter2(s) {
    let xx =''
    for(let i=0; i<s.length; i++){
        let flag = true
        for(let j=0; j<s.length; j++){
            if(s[i].toUpperCase()===s[j].toUpperCase() && i!==j){flag=false;}
        }
        if(flag && xx==='') xx =s[i]
    }
    return xx;
}

console.log(firstNonRepeatingLetter2('sTreSS'));
